package serverlet;

import Server.StudentServer;
import user.Student;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


@WebServlet(name = "ManagerServlet", urlPatterns = "/managerServlet")
public class ManagerServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        System.out.println("接收到了");
        String num = request.getParameter("num");
        System.out.println("获取到的用户名为："+num);
        String name = request.getParameter("name");
        System.out.println("获取到的用户名为："+name);
        String sex = request.getParameter("sex");
        System.out.println("获取到的用户名为："+sex);
        String birthday = request.getParameter("birthday");
        System.out.println("获取到的用户名为："+birthday);
        String Email = request.getParameter("Email");
        System.out.println("获取到的用户名为："+Email);
        String remark = request.getParameter("remark");
        System.out.println("获取到的用户名为："+remark);
        RequestDispatcher requestDispatcher = request.getRequestDispatcher("/managerinit");
        requestDispatcher.forward(request,response);
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request,response);
    }
}
